/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fresher.utility;

/**
 *
 * @author namlq2
 */
public class ValidateUtility {

    /**
     * Check if an value is empty
     *
     * @param value input value
     * @return true if not empty, false in other case
     */
    public static boolean checkNull(String value) {
        if (value == null || value.length() == 0 || value.equals("")) {
            return false;
        }
        return true;
    }

    public static boolean checkIsNumber(String value) {
        if (isNumber(value)) {
            return true;
        } else {
            return false;
        }
    }

    public static boolean isNumber(String str) {
        try {
            Integer.parseInt(str);
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
}
